package com.ftg.shopping.orderdetails.controller;

import com.ftg.shopping.config.LayuiPage;
import com.ftg.shopping.orderdetails.entity.Orderdetails;
import com.ftg.shopping.orderdetails.service.OrderdetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(description = "订单明细")
@RestController
@RequestMapping("/api/orderdetails")
public class OrderdetailsController {

    @Autowired
    OrderdetailsService orderdetailsService;

    @ApiOperation("layui分页查询带模糊")
    @GetMapping("/page2")
    public LayuiPage<Orderdetails> page2(@RequestParam int page, @RequestParam int limit, @RequestParam(required = false) String dname){
        return orderdetailsService.layuipage(page,limit,dname);

    }

    @ApiOperation("修改订单信息")
    @PostMapping("/update")
    public int update( Orderdetails d){
        return orderdetailsService.update(d);
    }
    @ApiOperation("按主键删除部门")
    @PostMapping("/del")
    public  int del( int id){
        return orderdetailsService.del(id);
    }

}
